Filter hook 'get_{$adjacent}_post_sort'

in WP Core File wp-includes/link-template.php at line 1988

Description

Filters the ORDER BY clause in the SQL for an adjacent post query. The dynamic portion of the hook name, `$adjacent`, refers to the type of adjacency, 'next' or 'previous'. Possible hook names include: - `get_next_post_sort` - `get_previous_post_sort`

Occurrences

Filename Line Number
wp-includes/link-template.php 1988

Parameters

Type Name Description
string $order_by The `ORDER BY` clause in the SQL.
WP_Post $post WP_Post object.
string $order Sort order. 'DESC' for previous post, 'ASC' for next.

PHP Doc

/**
	 * Filters the ORDER BY clause in the SQL for an adjacent post query.
	 *
	 * The dynamic portion of the hook name, `$adjacent`, refers to the type
	 * of adjacency, 'next' or 'previous'.
	 *
	 * Possible hook names include:
	 *
	 *  - `get_next_post_sort`
	 *  - `get_previous_post_sort`
	 *
	 * @since 2.5.0
	 * @since 4.4.0 Added the `$post` parameter.
	 * @since 4.9.0 Added the `$order` parameter.
	 *
	 * @param string $order_by The `ORDER BY` clause in the SQL.
	 * @param WP_Post $post    WP_Post object.
	 * @param string  $order   Sort order. 'DESC' for previous post, 'ASC' for next.
	 */